﻿using AnesSystem.Services;
using AnesSystem.ViewModels.Operation;
using AnesSystem.ViewModels.Operation.CQ.RCQRMYY;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.Operation.CQ.RCQRMYY
{
    /// <summary>
    /// AnesOperInfoCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class AnesOperInfoCtrl : UserControl
    {
        public AnesOperInfoCtrl()
        {
            InitializeComponent();
           
            this.DataContext = AnesOperInfoCtrlViewModel.Instance;
            IniteRadioBation();
            this.Loaded += AnesOperInfoCtrl_Loaded;
        }

        private void _txt_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            
        }

        private void AnesOperInfoCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            if (zxcc.IsChecked)
            {
                DataManager.Instance.CurrentPatientLink.QualityPojo.Zxjmcc = true;                
            }
        }

     

        private void dmccsj_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                dmccsj.Value = cusDatePicker.SelectedDateTime;
            }

          
        }

        private void zxjmccsj_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                zxjmccsj.Value = cusDatePicker.SelectedDateTime;
            }

        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(zxz, zxy);
            new RadioButtonHelper().ChangeRadioSatus(dmccz, dmccy);
            new RadioButtonHelper().ChangeRadioSatus(qmn1, qmn2, qmn3);
            new RadioButtonHelper().ChangeRadioSatus(zgnmz1, zgnmz2, zgnmz3, zgnmz4);
            new RadioButtonHelper().ChangeRadioSatus(shzt1, shzt2, shzt3);
        }

        private void ysss_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            DrugAndEventWindow.Instance.CusContent = new AnethOperInfoYiShissCtrl();
            DrugAndEventWindow.Instance.ShowDialog();
        }

        private void shzd_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            DrugAndEventWindow.Instance.CusContent = new AnethOperInfoShuHouZhenDuanCtrl();
            DrugAndEventWindow.Instance.ShowDialog();
        }
    }
}

